import React,{useContext} from 'react';
import {ColorContext} from './Color.js';


function Button(props) {

    const {dispatch} = useContext(ColorContext);

    return (
        <div>
            <button onClick={ () => dispatch({type:"UPDATE_COLOR",color:props.title})}>{props.title}</button>
        </div>
    )
}

export default Button;